IF  EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_MachineMSInstalledComponents_SrvrInstnc_SrvrInstncId]') AND parent_object_id = OBJECT_ID(N'[dbo].[MachineMSInstalledComponents]'))
BEGIN
     ALTER TABLE [dbo].[MachineMSInstalledComponents] DROP CONSTRAINT [FK_MachineMSInstalledComponents_SrvrInstnc_SrvrInstncId]
END
GO

ALTER TABLE [dbo].[MachineMSInstalledComponents] WITH CHECK ADD CONSTRAINT [FK_MachineMSInstalledComponents_SrvrInstnc_SrvrInstncId] 
     FOREIGN KEY([SrvrInstncId]) REFERENCES [dbo].[SrvrInstnc] ([SrvrInstncId])
GO
